<!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Models</title>
		<style>
			.curModels tr,td {
				background-color: white;
			}
			.curModels ul {
				margin: 3px;
				padding: 3px;
				padding-left: 20px;
			}
			
			.AddModel {
				
			}
			.AddModel form {
				display: inline-flex;
				flex-direction: column;
				justify-content: center;
				align-items: flex-end;
			}
			
		</style>
    </head>
    <body>
        <div class="curModels">
        <h1> Current models: </h1>
            <table border="1" style="border-collapse: collapse;">
                <tr>
                    <th>Main model no.</th>
                    <th>Sub model no.</th>
                </tr>
                {% for main in models %}
                <tr>
                    <td> {{ main }} </td>
                        <td>
                            {% for sub in models[main] %}
                            <li> <span style="color:red">{{ sub }} </span> <pre> &nbsp; {{ models[main][sub] }} </pre> </li>
                            {% endfor %}
                        </td>
                </tr>
                {% endfor %}
            </table>
        </div>

        <div class="AddModel">
            <h1> Add model: </h1>
            <p>
                <form action="" method="POST">
                    <div>Main No: <input type="text" name="Main" value={{ main_new }}></div>
                    <div>&nbsp;&nbsp;Sub No: <input type="text" name="Sub" value={{ sub_new }}></div>
                    <div>&nbsp;&nbsp;Description: <input type="text" name="Desc" value={{ desc_new }}></div>
                    {% for message in get_flashed_messages() %}
                    <div>{{ message }}</div>
                    {% endfor %}
                    <div>
						<input type="submit" name="action" value="Create">
						<input type="submit" name="action" value="Delete">
					</div>
                </form>
            </p>
        </div>
    </body>
</html>